$(function () {


});



/***************** 以下为自定义公共函数 **********************/

/**
 * 向下保留小数点
 * @param num
 * @param scale
 * @returns {string}
 */
function floorScale(num,scale) {
    num = num.toString().replace(/^0+/,'');
    if(num == '' || num.indexOf(".") === 0) {
        num = 0 + num;
    }
    var index = num.indexOf(".");
    if(index == -1) {
        return num;
    }
    num = num.substring(0,index + scale + 1);
    if(num.indexOf(".") != -1) {
        num = num.toString().replace(/0+$/,'');
        num = num.toString().replace(/\.$/,'');
    }
    return num;
}